<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">



    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('coupon_type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="getTypeList" item="vo"}
                <label for="row[coupon_type]-{$key}"><input id="row[coupon_type]-{$key}" name="row[coupon_type]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group" data-favisible="coupon_type=1">
        <label class="control-label col-xs-12 col-sm-2">{:__('assign_type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="assignTypeList" item="vo"}
                <label for="row[assign_type]-{$key}"><input id="row[assign_type]-{$key}" name="row[assign_type]" type="radio" value="{$key}" {in name="key" value="none"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
<!--    <div class="form-group" data-favisible="assign_type=users">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('assign_user_ids')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-assign_user_ids" data-source="user/user/index" class="form-control selectpage" data-multiple="true" data-params='{"custom[status]":"normal"}' data-field="nickname" data-format-item="{nickname}({id})" name="row[assign_user_ids]" type="text" value="">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group" data-favisible="assign_type=users">
        <label class="control-label col-xs-12 col-sm-2">{:__('assign_user_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="row[assign_user_ids][]" class="form-control selectpicker" required data-live-search="true" multiple>
                <?php if (!empty($userlist) && is_array($userlist)): ?>
                <?php foreach ($userlist as $item): ?>
                <option value="<?= htmlspecialchars($item['id']) ?>">
                    <?= htmlspecialchars($item['mobile']) ?> （<?= htmlspecialchars($item['nickname']) ?>）
                </option>
                <?php endforeach; ?>
                <?php else: ?>
                <option value="">没有可选项</option>
                <?php endif; ?>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>
    <div class="form-group" >
        <label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-money" data-rule="required" class="form-control" step="0.01" name="row[money]" type="number" value="0.00" placeholder="优惠券抵扣金额">
        </div>
    </div>

    <div class="form-group" data-favisible="">
        <label class="control-label col-xs-12 col-sm-2">{:__('Min_money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_money" data-rule="required" class="form-control" step="0.01" name="row[min_money]" type="number" value="0" placeholder="金额达到多少才能使用 0无门槛">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Expire_day')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-expire_day" data-rule="required" class="form-control" name="row[expire_day]" type="number" value="" placeholder="领取后多少天内有效，必须大于0">
        </div>
    </div>
<!--    <div class="form-group" data-favisible="assign_type=users">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('limit_use')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-limit_use" class="form-control" name="row[limit_use]" type="number" value="0" placeholder="填0不限制">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group" data-favisible="assign_type=none">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Total')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-total" data-rule="required" class="form-control" name="row[total]" type="number" value="0" placeholder="优惠券发放总数量">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
